<?php
session_start();
include "includes/auth.php";
if(credentials_valid($_POST['username'], $_POST['password'])){
    log_in($_POST['username']);
    header("Location: index.php?yay=1");
}else{
    header("Location: login.php?error=1");
    exit("You are being redirected");
}
?>